home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / seloptpage.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  2.9 KB  |  109 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11. // SelOptPage.cpp : implementation file
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "ltsample.h"
  16. #include "SelOptPage.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CSelOptPage property page
  26.  
  27. IMPLEMENT_DYNCREATE(CSelOptPage, CPropertyPage)
  28.  
  29. CSelOptPage::CSelOptPage() : CPropertyPage(CSelOptPage::IDD)
  30. {
  31.     m_iVersion = 4;
  32.     //{{AFX_DATA_INIT(CSelOptPage)
  33.     m_bArcs = FALSE;
  34.     m_bTexts = FALSE;
  35.     m_bInvisible = FALSE;
  36.     m_bTopLevel = FALSE;
  37.     m_bSegments = FALSE;
  38.     m_bBlocks = FALSE;
  39.     //}}AFX_DATA_INIT
  40. }
  41.  
  42. CSelOptPage::~CSelOptPage()
  43. {
  44. }
  45.  
  46. void CSelOptPage::DoDataExchange(CDataExchange* pDX)
  47. {
  48.     CPropertyPage::DoDataExchange(pDX);
  49.     //{{AFX_DATA_MAP(CSelOptPage)
  50.     DDX_Check(pDX, IDC_ARCS, m_bArcs);
  51.     DDX_Check(pDX, IDC_TEXTS, m_bTexts);
  52.     DDX_Check(pDX, IDC_INVISIBLE, m_bInvisible);
  53.     DDX_Check(pDX, IDC_TOPLEVEL, m_bTopLevel);
  54.     DDX_Check(pDX, IDC_INSERTS, m_bBlocks);
  55.     DDX_Check(pDX, IDC_GRAPHICS, m_bSegments);
  56.     //}}AFX_DATA_MAP
  57. }
  58.  
  59.  
  60. BEGIN_MESSAGE_MAP(CSelOptPage, CPropertyPage)
  61.     //{{AFX_MSG_MAP(CSelOptPage)
  62.     ON_BN_CLICKED(IDC_GRAPHICS, OnGraphics)
  63.     ON_BN_CLICKED(IDC_INSERTS, OnInserts)
  64.     //}}AFX_MSG_MAP
  65. END_MESSAGE_MAP()
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CSelOptPage message handlers
  69.  
  70. void CSelOptPage::OnGraphics() 
  71. {
  72.     if (m_iVersion == 4)
  73.     {
  74.         CButton *pGraphicsBt = (CButton *)GetDlgItem(IDC_GRAPHICS);
  75.         CButton *pInsertsBt = (CButton *)GetDlgItem(IDC_INSERTS);
  76.  
  77.         if (pGraphicsBt->GetCheck() == 0)
  78.             pInsertsBt->SetCheck(0);
  79.     }
  80. }
  81.  
  82. void CSelOptPage::OnInserts() 
  83. {
  84.     if (m_iVersion == 4)
  85.     {
  86.         CButton *pGraphicsBt = (CButton *)GetDlgItem(IDC_GRAPHICS);
  87.         CButton *pInsertsBt = (CButton *)GetDlgItem(IDC_INSERTS);
  88.  
  89.         if (pInsertsBt->GetCheck() == 1)
  90.             pGraphicsBt->SetCheck(1);
  91.     }
  92. }
  93.  
  94. BOOL CSelOptPage::OnInitDialog() 
  95. {
  96.     CPropertyPage::OnInitDialog();
  97.     
  98.     if (m_iVersion == 0)
  99.     {
  100.         CButton *pBt = (CButton *)GetDlgItem(IDC_GRAPHICS);
  101.         pBt->EnableWindow(FALSE);
  102.         pBt = (CButton *)GetDlgItem(IDC_INSERTS);
  103.         pBt->EnableWindow(FALSE);
  104.     }
  105.     
  106.     return TRUE;  // return TRUE unless you set the focus to a control
  107.                   // EXCEPTION: OCX Property Pages should return FALSE
  108. }
  109.